package com.macaline.service.impl;

import com.macaline.mapper.SysMenuMapper;
import com.macaline.entity.SysMenu;
import com.macaline.service.SysMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SysMenuServiceImpl implements SysMenuService {

    @Autowired
    SysMenuMapper sysMenuMapper;

    @Override
    public List<SysMenu> selectList() {
        return sysMenuMapper.selectByMap(null);
    }

    @Override
    public SysMenu insert(SysMenu sysMenu) {
        int insert = sysMenuMapper.insert(sysMenu);
        if(insert < 1){
            return null;
        }
        return sysMenu;
    }

    @Override
    public SysMenu select(SysMenu sysMenu) {
        return null;
    }

    @Override
    public SysMenu update(SysMenu sysMenu) {
        return null;
    }

    @Override
    public int delete(Integer id) {
        return sysMenuMapper.deleteById(id);
    }

}
